/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.grt192.demos;

import com.grt192.core.GRTObject;
import com.grt192.event.component.PulseSwitchListener;
import com.grt192.spot.actuator.GRTDemoLED;
import com.grt192.spot.mechanism.hauntedHouse.StatusLight;
import com.grt192.spot.sensor.GRTPulseSwitch;

/**
 *
 * @author ajc
 */
public class PulseSwitchDemo extends GRTObject implements PulseSwitchListener {

    StatusLight sl;

    public PulseSwitchDemo() {
        GRTPulseSwitch s = new GRTPulseSwitch(0, 5, "s");
        s.addPulseSwitchListener(this);
        s.start();

        sl = new StatusLight(new GRTDemoLED(0));
        sl.rawColor(GRTDemoLED.Color.NONE);
        setPrinting(true);
    }

    public void pulseRead(GRTPulseSwitch s, int usec) {
        sl.blinkonBlack(GRTDemoLED.Color.BLUE, 50);
        log("pulse read");

    }
}
